Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 20, 2025

  • Analyze the current VitePress configuration and OG tag setup
  • Enhance transformHead function to add page-specific OG and Twitter meta tags
  • Test the changes on various page types (home, docs, rules)
  • Verify link sharing shows correct titles and descriptions

Solution implemented:

Enhanced the transformHead function in .vitepress/config/shared.ts to dynamically add page-specific Open Graph and Twitter meta tags:

  • og:title and twitter:title based on page title (from frontmatter or page title)
  • og:description and twitter:description based on page description (from frontmatter, page description, or fallback)
  • og:url based on actual page URL with proper path construction
  • Removed global og:url that incorrectly pointed to GitHub

Results verified:

✅ Home page (/): Uses "The JavaScript Oxidation Compiler" and correct URL
✅ Linter page (/docs/guide/usage/linter.html): Uses "Linter" title and correct URL
✅ Branding page (/branding.html): Uses "Branding" title and correct URL
✅ All pages now have proper page-specific URLs instead of generic GitHub link
✅ Linting passes with no issues
✅ Build completes successfully

When sharing sub-pages now, the link preview will show the correct page-specific title and URL, solving the SEO issue described.

Fixes #459.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor Author

Copilot AI commented Aug 20, 2025

@Boshen 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copy link

netlify bot commented Aug 20, 2025

Deploy Preview for oxc-project ready!

Name Link
🔨 Latest commit 0880c63
🔍 Latest deploy log https://app.netlify.com/projects/oxc-project/deploys/68a5eec879acac0008d43f0e
😎 Deploy Preview https://deploy-preview-460--oxc-project.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Boshen Boshen marked this pull request as ready for review August 20, 2025 15:53
@Boshen Boshen changed the title [WIP] seo: add appropriate og tags for link sharing seo: add appropriate og tags for link sharing Aug 20, 2025
@Boshen Boshen merged commit 43c50a6 into main Aug 20, 2025
5 checks passed
@Boshen Boshen deleted the copilot/fix-459 branch August 20, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

seo: add appropriate og tags for link sharing
2 participants